package com.example.demo.utils;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;


public class TestTokenInfo {
	public static void main(String[] args) throws Exception {
		String token="To7nmrmrrK1r1r4m20r8ezWrMGopcVuf";
		String businessCode="yxzq";


		
		//System.out.println(getProductTokenPwd("xWL8jPAJySjLQy46cuy8UZ5yzDtuWxjT", "wyzq"));
		
		System.out.println(getTestTokenPwd("DRtcx3EYvaNIov4VHyv8SbCvN0O6RyoF",  "wyzq"));
	}
	
	
	
	
	
	
	public static String getTestTokenPwd(String token,String businessCode ) throws Exception{
		String ret = HttpUtil.post("http://test.cardniu.com/data-manage-cgi/checkReq", "{\"token\":\"" + token + "\",\"checkParams\":\"token\",\"businessCode\":\""+businessCode+"\"}",null);
		JSONObject jsonObject=JSON.parseObject(ret);
		return  jsonObject.getJSONObject("info").getString("secretKey");
	}
	
	public static String getProductTokenPwd(String token,String businessCode ) throws Exception{
		String ret = HttpUtil.post("http://credit.cardniu.com/data-manage-cgi/checkReq", "{\"token\":\"" + token + "\",\"checkParams\":\"token\",\"businessCode\":\""+businessCode+"\"}",null);
		JSONObject jsonObject=JSON.parseObject(ret);
		return  jsonObject.getJSONObject("info").getString("secretKey");
	}
	

	
}
